package com.plian.system.dao.sys.per;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
@Component
public class FunGroupDao {
    @Resource(name = "daoSupport")
    private DaoSupport dao;
    /**
     * 新增权限组-权限
     */
    public void FunGroupConfig(List<PageData> list) throws Exception {
        dao.save("FunGroupMapper.FunGroupConfig",list);
    }
    /**
     * 根据权限组Id删除相关单位权限
     * @param groupId
     * @throws Exception
     */
    public void del_FunGroup(String groupId) throws Exception {
        dao.delete("FunGroupMapper.del_FunGroup",groupId);
    }
    /**
     * 根据用户id查询有权限的单位
     * @param userId
     * @throws Exception
     * @return
     */
    public List<PageData> queryFunGroup(String userId) throws Exception {
        return (List<PageData>) dao.findForList("FunGroupMapper.queryFunGroup",userId);
    }
}
